﻿using System.Web.Mvc;

namespace Zatify.WebUI.Areas.Admin
{
    public class AdminAreaRegistration : AreaRegistration
    {
        public override string AreaName
        {
            get
            {
                return "Admin";
            }
        }

        public override void RegisterArea(AreaRegistrationContext context)
        {
            context.MapRoute(
                "Admin_Promotion",
                "Admin/Business/{businessId}/Promotion/{id}",
                new { controller = "Business", action = "Promotion" });

            context.MapRoute(
               "Admin_User",
               "Admin/Users/{action}",
               new { controller = "Users", action = "List", id = UrlParameter.Optional }
            );

            context.MapRoute(
                "Admin_Business",
                "Admin/Business/{action}",
                new { controller = "Business", action = "List", id = UrlParameter.Optional }
            );

            context.MapRoute(
                "Admin_Business_By_Id",
                "Admin/Business/{action}/{id}",
                new { controller = "Business", action = "List", id = UrlParameter.Optional }
            );

            context.MapRoute(
               "Admin_Categories",
               "Admin/Categories/{action}",
               new { controller = "Categories", action = "List", id = UrlParameter.Optional }
            );

            context.MapRoute(
               "Admin_Rates",
               "Admin/Rates/{action}",
               new { controller = "Rates", action = "List", id = UrlParameter.Optional }
            );

            context.MapRoute(
               "Admin_Defaults",
               "Admin/Defaults/{action}",
               new { controller = "Defaults", action = "List", id = UrlParameter.Optional }
            );

            context.MapRoute(
               "Admin_Reports",
               "Admin/Reports/{action}",
               new { controller = "Reports", action = "List", id = UrlParameter.Optional }
            );

            context.MapRoute(
               "Admin_SystemUsers",
               "Admin/SystemUsers/{action}",
               new { controller = "SystemUsers", action = "List", id = UrlParameter.Optional }
            );

            context.MapRoute(
               "Admin_MessageCenter",
               "Admin/MessageCenter/{action}",
               new { controller = "MessageCenter", action = "List", id = UrlParameter.Optional }
            );

            context.MapRoute(
                "Admin_ExcelReports",
                "Admin/ExcelReports/{action}",
                new { controller = "ExcelReports", id = UrlParameter.Optional }
            );

            context.MapRoute(
                "Admin_Account",
                "Admin/Account/{action}",
                new { controller = "Account", action = "Login" }
            );

            context.MapRoute(
                null,
                "Admin/{controller}/{action}/page{page}",
                new { controller = "Users", action = "List", page = 1 });

            context.MapRoute(
                "Admin_Default",
                "Admin/{controller}/{action}/{id}",
                new { controller = "Account", action = "Login", id = UrlParameter.Optional }
            );
        }
    }
}
